﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Formsafaf
    {
        Barbaris Barbaris = new Barbaris();
        Cow Cow = new Cow();
        Iris Iris = new Iris();
        Lastochka Lastochka = new Lastochka();
        Romashka Romashka = new Romashka();
        Step Step = new Step();
        NewYearPresent NewYearPresent = new NewYearPresent();
        Random rand = new Random();

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        
        private void button1_Click(object sender, EventArgs e)
        {
            button2.Enabled = true;
            button3.Enabled = true;
            button4.Enabled = true;

            Barbaris.CreatePresent(rand.Next(0 , 500));
            Cow.CreatePresent(rand.Next(0, 500));
            Iris.CreatePresent(rand.Next(0, 500));
            Lastochka.CreatePresent(rand.Next(0, 500));
            Romashka.CreatePresent(rand.Next(0, 500));
            Step.CreatePresent(rand.Next(0, 500));
            NewYearPresent.CreateNewYearPresent(Barbaris, Cow, Iris, Lastochka, Romashka, Step);
            MessageBox.Show("Новогодний подарок успешно создан.");
        }
       
        private void button2_Click12(object sender, EventArgs e)
        {
            GetWeight D = new GetWeight();
            int Weight = D.GetWeightofPresent(Barbaris, Cow, Iris, Lastochka, Romashka, Step);
            MessageBox.Show("Вес подарка: " + Weight.ToString() + " грамм");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            pictureBox1.Visible = true;  
        }

        private void button4_Click(object sender, EventArgs e)
        {
            button2.Enabled = false;
            button3.Enabled = false;
            button4.Enabled = false;
            pictureBox1.Visible = false;
        }
    }
}
